import random

a = int(random.randint(0, 101))
c = 5000

while (True):
    if c > 500:
        b = int(input("请输入你猜的数"))
        if a == b:
            c = c + 3000
            print("你猜对了", c)
            break
        elif (a > b):
            print("你猜的太小了")
            c = c - 500
        elif (a < b):
            print("你猜的太大了")
            c = c - 500
    else:
        print("你的资金不足")
        break
while True:
    i=int(input())
    if int(i)==1:
        a = int(random.randint(0, 101))
        while (True):
            if c > 500:
                b = int(input("请输入你猜的数"))
                if a == b:
                    c = c + 3000
                    print("你猜对了", c)
                    break
                elif (a > b):
                    print("你猜的太小了")
                    c = c - 500
                elif (a < b):
                    print("你猜的太大了")
                    c = c - 500
            else:
                print("你的资金不足")
                break
    else:
        break;


